import { Router } from 'express';
import { verifyToken } from '../../middleware/auth';
import {
  getPolicyNewsList,
  getPolicyNewsDetail,
  createPolicyNews,
  updatePolicyNews,
  deletePolicyNews,
  updatePolicyNewsStatus,
  getAdmissionNews,
  getMajorIntroductions
} from './controller';

const router = Router();

// 管理端路由，需要验证token
router.use('/admin', verifyToken);
router.get('/admin', getPolicyNewsList);
router.get('/admin/:id', getPolicyNewsDetail);
router.post('/admin', createPolicyNews);
router.put('/admin/:id', updatePolicyNews);
router.delete('/admin/:id', deletePolicyNews);
router.put('/admin/:id/status', updatePolicyNewsStatus);

// 前台路由，不需要验证token
router.get('/admission', getAdmissionNews);
router.get('/major', getMajorIntroductions);
router.get('/detail/:id', getPolicyNewsDetail);

export default router; 